package io.hepu.robotize.service.impl;

import io.hepu.robotize.base.BaseService;
import io.hepu.robotize.dao.UserMapper;
import io.hepu.robotize.dto.ActiveUser;
import io.hepu.robotize.enums.AuthType;
import io.hepu.robotize.model.User;
import io.hepu.robotize.service.IUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserService extends BaseService<User, String, UserMapper> implements IUserService {

    @Override
    public ActiveUser findActUserByName(String userName, AuthType authType) {
        return getResposity().selectActUserByName(userName, authType.name());
    }

    @Override
    public User findByMobile(String mobile) {
        return getResposity().selectByMobile(mobile);
    }

}
